package com.blog.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.blog.service.entity.AnalysisVisitQuantity;
import com.blog.service.inter.AnalysisVisitQtyService;
import com.blog.service.model.AnalysisVisitQuantityMapper;

/**
 * 文件名： com.blog.service.impl.AnalysisVisitQtyServiceImpl.java
 * 作者： WenBin
 * 日期： 2017年4月12日
 * 功能说明：数据访问统计接口实现类
 * =========================================================
 * 修改记录：
 * 修改作者 日期 修改内容
 * =========================================================
 * Copyright (c) 2010-2011 .All rights reserved.
 */
@Service
public class AnalysisVisitQtyServiceImpl implements AnalysisVisitQtyService {

	@Autowired
	private AnalysisVisitQuantityMapper analysisVisitQuantityMapper;

	@Override
	public AnalysisVisitQuantity saveAnalysisVisitQuantity(AnalysisVisitQuantity avq) {

		int i = analysisVisitQuantityMapper.insertSelective(avq);
		if (i > 0) {
			return avq;
		}
		return null;
	}

	@Override
	public AnalysisVisitQuantity updateAnalysisVisitQuantity(AnalysisVisitQuantity avq) {

		int i = analysisVisitQuantityMapper.updateByPrimaryKey(avq);
		if (i > 0) {
			return avq;
		}
		return null;
	}

	@Override
	public AnalysisVisitQuantity deleteAnalysisVisitQuantity(AnalysisVisitQuantity avq) {

		int i = analysisVisitQuantityMapper.deleteByPrimaryKey(avq.getVisitQuantityId());
		if (i > 0) {
			return avq;
		}
		return null;
	}

}
